package cn.iocoder.yudao.module.ai.controller.app.picture;

import cn.iocoder.yudao.module.ai.common.IdUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;

import cn.iocoder.yudao.module.ai.controller.admin.picture.vo.*;
import cn.iocoder.yudao.module.ai.dal.dataobject.picture.PictureDO;
import cn.iocoder.yudao.module.ai.service.picture.PictureService;

@Tag(name = "管理后台 - 图片")
@RestController
@RequestMapping("/app/ai/picture")
@Validated
public class AppPictureController {

    @Resource
    private PictureService pictureService;

    @GetMapping("/page")
    @Operation(summary = "获得图片分页")
    public CommonResult<PageResult<PictureRespVO>> getPicturePage(@Valid PicturePageReqVO pageReqVO) {
        PageResult<PictureDO> pageResult = pictureService.getPicturePage(pageReqVO);
        return success(BeanUtils.toBean(pageResult, PictureRespVO.class));
    }


}